import os

# 定义类模板
class_template = """
package com.midea.ext.model.influx.yasuoji;

import com.influxdb.annotations.Column;
import com.influxdb.annotations.Measurement;
import java.util.Date;

@Measurement(name="{class_name}")
public class {class_name} {{
    
    @Column(tag = true)
    private String equipmentNumber; //设备编号

    @Column(tag = true)
    private String testformitemNumber;// 委托项编号

    @Column(timestamp = true)
    private Date actualTime;// 实际接收时间

    @Column(tag = true)
    private String testFormItemName;// 委托测试项名称
    @Column(tag = true)
    private String equipmentName;//设备名称
    @Column(tag = true)
    private String equipmentTWName;// 台位名称
    @Column(tag = true)
    private String testFormNumber;// 委托测试编号
    @Column(tag = true)
    private String consignDpt = null;//委托部门
    @Column(tag = true)
    private String testCondition = null;//检测条件
    @Column(tag = true)
    private String sampleModel = null;//样品型号
    @Column(tag = true)
    private String sampleNumber = null;//样品编号


    @Column
    private String varStr1;// 属性值1，压缩机：电流上限  电机：电流上限
    @Column
    private String varStr2;// 属性值2 压缩机：电流下限  电机：电流下限
    @Column
    private String varStr3;// 属性值3 压缩机：排气压力上限  电机：电压上限
    @Column
    private String varStr4;// 属性值4 压缩机：排气压力下限  电机：电压下限
    @Column
    private String varStr5;// 属性值5 压缩机：吸气压力上限  电机：功率上限
    @Column
    private String varStr6;// 属性值6 压缩机：吸气压力下限  电机：功率下限
    @Column
    private String varStr7;// 属性值7 压缩机：排气温度上限  电机：温度上限
    @Column
    private String varStr8;// 属性值8 压缩机：排气温度下限  电机：温度下限
    @Column
    private String varStr9;// 属性值9 压缩机：吸气温度上限  电机：湿度上限
    @Column
    private String varStr10;// 属性值10 压缩机：吸气温度下限  电机：湿度下限
    @Column
    private String varStr11;// 属性值11 压缩机：壳体温度上限
    @Column
    private String varStr12;// 属性值12 压缩机：壳体温度下限
    @Column
    private String varStr13;// 属性值13 压缩机：频率上限
    @Column
    private String varStr14;// 属性值14 压缩机：频率下限
    @Column
    private String varStr15;
    @Column
    private String varStr16;
    @Column
    private String varStr17;
    @Column
    private String varStr18;
    @Column
    private String varStr19;
    @Column
    private String varStr20;


    public String getEquipmentNumber() {{
        return equipmentNumber;
    }}

    public void setEquipmentNumber(String equipmentNumber) {{
        this.equipmentNumber = equipmentNumber;
    }}

    public String getTestformitemNumber() {{
        return testformitemNumber;
    }}

    public void setTestformitemNumber(String testformitemNumber) {{
        this.testformitemNumber = testformitemNumber;
    }}

    public Date getActualTime() {{
        return actualTime;
    }}

    public void setActualTime(Date actualTime) {{
        this.actualTime = actualTime;
    }}

    public String getVarStr1() {{
        return varStr1;
    }}

    public void setVarStr1(String varStr1) {{
        this.varStr1 = varStr1;
    }}

    public String getVarStr2() {{
        return varStr2;
    }}

    public void setVarStr2(String varStr2) {{
        this.varStr2 = varStr2;
    }}

    public String getVarStr3() {{
        return varStr3;
    }}

    public void setVarStr3(String varStr3) {{
        this.varStr3 = varStr3;
    }}

    public String getVarStr4() {{
        return varStr4;
    }}

    public void setVarStr4(String varStr4) {{
        this.varStr4 = varStr4;
    }}

    public String getVarStr5() {{
        return varStr5;
    }}

    public void setVarStr5(String varStr5) {{
        this.varStr5 = varStr5;
    }}

    public String getVarStr6() {{
        return varStr6;
    }}

    public void setVarStr6(String varStr6) {{
        this.varStr6 = varStr6;
    }}

    public String getVarStr7() {{
        return varStr7;
    }}

    public void setVarStr7(String varStr7) {{
        this.varStr7 = varStr7;
    }}

    public String getVarStr8() {{
        return varStr8;
    }}

    public void setVarStr8(String varStr8) {{
        this.varStr8 = varStr8;
    }}

    public String getVarStr9() {{
        return varStr9;
    }}

    public void setVarStr9(String varStr9) {{
        this.varStr9 = varStr9;
    }}

    public String getVarStr10() {{
        return varStr10;
    }}

    public void setVarStr10(String varStr10) {{
        this.varStr10 = varStr10;
    }}

    public String getVarStr11() {{
        return varStr11;
    }}

    public void setVarStr11(String varStr11) {{
        this.varStr11 = varStr11;
    }}

    public String getVarStr12() {{
        return varStr12;
    }}

    public void setVarStr12(String varStr12) {{
        this.varStr12 = varStr12;
    }}

    public String getVarStr13() {{
        return varStr13;
    }}

    public void setVarStr13(String varStr13) {{
        this.varStr13 = varStr13;
    }}

    public String getVarStr14() {{
        return varStr14;
    }}

    public void setVarStr14(String varStr14) {{
        this.varStr14 = varStr14;
    }}

    public String getVarStr15() {{
        return varStr15;
    }}

    public void setVarStr15(String varStr15) {{
        this.varStr15 = varStr15;
    }}

    public String getVarStr16() {{
        return varStr16;
    }}

    public void setVarStr16(String varStr16) {{
        this.varStr16 = varStr16;
    }}

    public String getVarStr17() {{
        return varStr17;
    }}

    public void setVarStr17(String varStr17) {{
        this.varStr17 = varStr17;
    }}

    public String getVarStr18() {{
        return varStr18;
    }}

    public void setVarStr18(String varStr18) {{
        this.varStr18 = varStr18;
    }}

    public String getVarStr19() {{
        return varStr19;
    }}

    public void setVarStr19(String varStr19) {{
        this.varStr19 = varStr19;
    }}

    public String getVarStr20() {{
        return varStr20;
    }}

    public void setVarStr20(String varStr20) {{
        this.varStr20 = varStr20;
    }}

    public String getTestFormItemName() {{
        return testFormItemName;
    }}

    public void setTestFormItemName(String testFormItemName) {{
        this.testFormItemName = testFormItemName;
    }}

    public String getEquipmentName() {{
        return equipmentName;
    }}

    public void setEquipmentName(String equipmentName) {{
        this.equipmentName = equipmentName;
    }}

    public String getEquipmentTWName() {{
        return equipmentTWName;
    }}

    public void setEquipmentTWName(String equipmentTWName) {{
        this.equipmentTWName = equipmentTWName;
    }}

    public String getTestFormNumber() {{
        return testFormNumber;
    }}

    public void setTestFormNumber(String testFormNumber) {{
        this.testFormNumber = testFormNumber;
    }}

    public String getConsignDpt() {{
        return consignDpt;
    }}

    public void setConsignDpt(String consignDpt) {{
        this.consignDpt = consignDpt;
    }}

    public String getTestCondition() {{
        return testCondition;
    }}

    public void setTestCondition(String testCondition) {{
        this.testCondition = testCondition;
    }}

    public String getSampleModel() {{
        return sampleModel;
    }}

    public void setSampleModel(String sampleModel) {{
        this.sampleModel = sampleModel;
    }}

    public String getSampleNumber() {{
        return sampleNumber;
    }}

    public void setSampleNumber(String sampleNumber) {{
        this.sampleNumber = sampleNumber;
    }}
}}
"""

# 创建目标目录
output_dir = "d:/a"
os.makedirs(output_dir, exist_ok=True)

# 生成48个类
for i in range(1, 9):
    class_name = f"ActValCar{i}"
    file_content = class_template.format(class_name=class_name)
    
    # 写入文件
    with open(os.path.join(output_dir, f"{class_name}.java"), "w",encoding="utf-8") as file:
        file.write(file_content)

print("类已成功生成并保存到 d:/a 目录中。")